package com.abvnet.project.water.project.service;

import com.abvnet.common.utils.security.ShiroUtils;
import com.abvnet.common.utils.text.Convert;
import com.abvnet.project.water.project.domain.ProjectCustomerEval;
import com.abvnet.project.water.project.mapper.ProjectCustomerEvalMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客户评价 服务层实现
 * 
 * @author duj
 * @date 2019-08-17
 */
@Service
public class ProjectCustomerEvalServiceImpl implements IProjectCustomerEvalService {
	@Autowired
	private ProjectCustomerEvalMapper projectCustomerEvalMapper;

	/**
     * 查询客户评价信息
     * 
     * @param evalId 客户评价ID
     * @return 客户评价信息
     */
    @Override
	public ProjectCustomerEval selectProjectCustomerEvalById(Long evalId) {
	    return projectCustomerEvalMapper.selectProjectCustomerEvalById(evalId);
	}
	
	/**
     * 查询客户评价列表
     * 
     * @param projectCustomerEval 客户评价信息
     * @return 客户评价集合
     */
	@Override
	public List<ProjectCustomerEval> selectProjectCustomerEvalList(ProjectCustomerEval projectCustomerEval) {
	    return projectCustomerEvalMapper.selectProjectCustomerEvalList(projectCustomerEval);
	}
	
    /**
     * 新增客户评价
     * 
     * @param projectCustomerEval 客户评价信息
     * @return 结果
     */
	@Override
	public int insertProjectCustomerEval(ProjectCustomerEval projectCustomerEval) {
	    return projectCustomerEvalMapper.insertProjectCustomerEval(projectCustomerEval);
	}
	
	/**
     * 修改客户评价
     * 
     * @param projectCustomerEval 客户评价信息
     * @return 结果
     */
	@Override
	public int updateProjectCustomerEval(ProjectCustomerEval projectCustomerEval) {
        projectCustomerEval.setUserId(ShiroUtils.getUserId());
	    return projectCustomerEvalMapper.updateProjectCustomerEval(projectCustomerEval);
	}

	/**
     * 删除客户评价对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteProjectCustomerEvalByIds(String ids) {
		return projectCustomerEvalMapper.deleteProjectCustomerEvalByIds(Convert.toStrArray(ids));
	}
	
}